package com.sphd.emanu.activity.changepwd;

import android.content.Context;

import com.google.gson.JsonObject;
import com.sphd.emanu.mvp.BasePresenterImpl;
import com.wzutils.L;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * MVPPlugin
 *  邮箱 784787081@qq.com
 */

public class ChangePwdPresenter extends BasePresenterImpl<ChangePwdContract.View> implements ChangePwdContract.Presenter{

    @Override
    public void updatePassword(String logonname, String logonpwd) {
        emanuService.updatePassword(logonname, logonpwd).enqueue(new Callback<JsonObject>() {
            @Override
            public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
                L.e(response.toString());
                mView.setRes(res(response));
            }

            @Override
            public void onFailure(Call<JsonObject> call, Throwable t) {
                Error(t);
            }
        });
    }
}
